Skip to content

Add dedicated exception for HttpStatus.PRECONDITION_FAILED#36807

Open
dominik-kovacs wants to merge 1 commit into
spring-projects:mainfrom
dominik-kovacs:feature/precondition-failed-http-client-error
Open

Add dedicated exception for HttpStatus.PRECONDITION_FAILED#36807
dominik-kovacs wants to merge 1 commit into
spring-projects:mainfrom
dominik-kovacs:feature/precondition-failed-http-client-error

Conversation

@dominik-kovacs
Copy link
Copy Markdown

Add a dedicated HttpClientErrorException.PreconditionFailed subclass for HTTP 412 status code, consistent with the existing pattern for other 4xx status codes (NotFound, Gone, Conflict, etc.).

This allows callers to catch HttpClientErrorException.PreconditionFailed directly rather than inspecting the status code on a generic HttpClientErrorException.

Signed-off-by: Dominik Kovács <dominik.kovacs28@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 14, 2026
Copy link
Copy Markdown
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An equivalent change to be made also in WebClientResponseException.

@rstoyanchev rstoyanchev changed the title Add Precondition Failed http client error exception Add dedicated exception for HttpStatus.PRECONDITION_FAILED Jun 2, 2026
@rstoyanchev rstoyanchev self-assigned this Jun 2, 2026
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 2, 2026
@rstoyanchev rstoyanchev added this to the 7.1.0-M1 milestone Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants